package com.szm.userserver.serviceimpl;

import com.szm.userserver.entity.UserMongo;
import com.szm.userserver.mapper.UserMongoDao;
import com.szm.userserver.service.UserMongoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.awt.print.Pageable;
import java.util.List;

@Service("UserMongoService")
public class UserMongoServiceImpl implements UserMongoService {

    @Autowired
    private UserMongoDao userMongoDao;

    @Override
    public List<UserMongo> findAll() {
        return userMongoDao.findAll();
    }

    @Override
    public UserMongo getUserById(Integer id) {
        return userMongoDao.getUserById(id);
    }

    @Override
    public void insert(UserMongo userMongo) {
        userMongoDao.insert(userMongo);
    }

    @Override
    public void update(UserMongo userMongo) {
        userMongoDao.update(userMongo);
    }

    @Override
    public void insertAll(List<UserMongo> userMongos) {
        userMongoDao.insertAll(userMongos);
    }

    @Override
    public void remove(Integer id) {
        userMongoDao.remove(id);
    }

    @Override
    public List<UserMongo> findByPage(UserMongo userMongo, Pageable pageable) {
        return userMongoDao.findByPage(userMongo, pageable);
    }
}
